package com.harveyspace.aes.social.enums;

/**
 * 社交平台类型枚举类
 *
 * @Author <a href="harveyer@163.com">harvey</a>
 * @date 2018/2/9
 */
public enum SocialTypeEnum {

    WEIXIN("weixin", 1, "微信"),
    QQ("qq", 2, "qq"),
    WEIBO("weibo", 3, "微博"),
    STEAM("steam", 4, "steam"),
    FACEBOOK("facebook", 5, "facebook"),
    TWITTER("twitter", 6, "twitter"),
    INSTAGRAM("instagram", 7, "instagram"),
    BATTLENNET("battlennet", 8, "暴雪");

    private String name;

    private int value;

    private String desc;

    SocialTypeEnum(String name, int value, String desc) {
        this.name = name;
        this.value = value;
        this.desc = desc;
    }

    public String getName() {
        return name;
    }

    public int getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static boolean isTypeLegal(String type) {

        if (type != null) {
            for (SocialTypeEnum platformType : SocialTypeEnum.values()) {
                if (type.equals(platformType.getName())) {
                    return true;
                }
            }
        }

        return false;
    }
}
